-- GENERATED SPELL FOR [Darkcrest Sorceress] --


function spell0_19947(pUnit, Event) --@Arcane Bolt,n/a--
pUnit:FullCastSpellOnTarget(13901,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_19947', 2500, 1)
end

function spell1_19947(pUnit, Event) --@Freezing Circle,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(34787,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_19947', 1, 1)
end

function spell2_19947(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(12544,pUnit)
pUnit:RegisterEvent('Sorts_19947', 0, 1)
end

function Sorts_19947(pUnit, Event)
local choix_sorts_19947 = math.random(0, 2)
if choix_sorts_19947 == 0 then
pUnit:RegisterEvent('spell0_19947', 1, 1)
end
if choix_sorts_19947 == 1 then
pUnit:RegisterEvent('spell1_19947', 1, 1)
end
if choix_sorts_19947 == 2 then
pUnit:RegisterEvent('spell2_19947', 1, 1)
end
end

function mob19947_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_19947', math.random(1500, 3000), 1)
end

function mob19947_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob19947_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob19947_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(19947, 1, 'mob19947_Action')
RegisterUnitEvent(19947, 2, 'mob19947_Leave')
RegisterUnitEvent(19947, 3, 'mob19947_Kill')
RegisterUnitEvent(19947, 4, 'mob19947_Die')
